﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using JM.JCY.BusinessEntity;
using JM.JCY.Proxy;
using NCS.IConnect.ApplicationContexts;
using JM.JCY.Common;
using JM.JCY.Common.Utilities;
using Microsoft.SharePoint;

namespace JM.JCY.SharePointComponent.IncorruptArchives.CreateWeiFaWeiJi
{
    public partial class CreateWeiFaWeiJiUserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
        }

        protected void imgSubmit_Click(object sender, ImageClickEventArgs e)
        {
            using (IncorruptProxy proxy = new IncorruptProxy())
            {
                var newDT =new IncorruptDataSet.T_WeiFaWeiJiDataTable();
                var newRow = newDT.NewT_WeiFaWeiJiRow();

                newRow.Number = this.txtNumber.Text;
                newRow.Date = this.dtDate.SelectedDate;
                newRow.Source = this.txtSource.Text;
                newRow.Case_Content = this.txtContent.Text;
                newRow.Result = this.txtResult.Text;
                newRow.Remark = this.txtResult.Text;
                newRow.Filler = this.txtFiller.Text;

                JCYUtility.UpdateCommonFields(newRow, "Iori");
                newDT.AddT_WeiFaWeiJiRow(newRow);
                proxy.UpdateWeiFaWeiJi(newDT);

                Response.Redirect("WeiFaWeiJi.aspx");
            }
        }

        protected void imgCancel_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("WeiFaWeiJi.aspx");
        }
    }
}
